using System.Windows.Forms;

namespace ShadeTree.Binding.Dialogs
{
    public class MessageBoxCreator : IMessageBoxCreator
    {
        #region IMessageBoxCreator Members

        public void ShowMessage(string caption, string body)
        {
            MessageBox.Show(body, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public void ShowMessage(UserMessage message)
        {
            ShowMessage(message.Caption, message.Body);
        }

        public bool PromptUser(string caption, string body)
        {
            return MessageBox.Show(body, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
        }

        public bool PromptUser(UserMessage message)
        {
            return PromptUser(message.Caption, message.Body);
        }

        #endregion
    }
}